import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";

const { createConfirm } = useMessage();

enum Api {
  list = '/TbJobTicket/tbJobTicket/list',
  listForRelevanceJobTicket = '/TbJobTicket/tbJobTicket/listForRelevanceJobTicket',
  save= '/TbJobTicket/tbJobTicket/add',
  edit= '/TbJobTicket/tbJobTicket/edit',
  deleteOne = '/TbJobTicket/tbJobTicket/delete',
  deleteBatch = '/TbJobTicket/tbJobTicket/deleteBatch',
  importExcel = '/TbJobTicket/tbJobTicket/importExcel',
  exportXls = '/TbJobTicket/tbJobTicket/exportXls',
  tbJobTicketAuditRecordList = '/TbJobTicket/tbJobTicket/listTbJobTicketAuditRecordByMainId',
  tbJobTicketAuditRecordSave= '/TbJobTicket/tbJobTicket/addTbJobTicketAuditRecord',
  tbJobTicketAuditRecordEdit= '/TbJobTicket/tbJobTicket/editTbJobTicketAuditRecord',
  tbJobTicketAuditRecordDelete = '/TbJobTicket/tbJobTicket/deleteTbJobTicketAuditRecord',
  tbJobTicketAuditRecordDeleteBatch = '/TbJobTicket/tbJobTicket/deleteBatchTbJobTicketAuditRecord',
  tbJobTicketJsaAnalyzeList = '/TbJobTicket/tbJobTicket/listTbJobTicketJsaAnalyzeByMainId',
  tbJobTicketJsaAnalyzeSave= '/TbJobTicket/tbJobTicket/addTbJobTicketJsaAnalyze',
  tbJobTicketJsaAnalyzeEdit= '/TbJobTicket/tbJobTicket/editTbJobTicketJsaAnalyze',
  tbJobTicketJsaAnalyzeDelete = '/TbJobTicket/tbJobTicket/deleteTbJobTicketJsaAnalyze',
  tbJobTicketJsaAnalyzeDeleteBatch = '/TbJobTicket/tbJobTicket/deleteBatchTbJobTicketJsaAnalyze',
  tbJobTicketGasAnalysisList = '/TbJobTicket/tbJobTicket/listTbJobTicketGasAnalysisByMainId',
  tbJobTicketGasAnalysisSave= '/TbJobTicket/tbJobTicket/addTbJobTicketGasAnalysis',
  tbJobTicketGasAnalysisEdit= '/TbJobTicket/tbJobTicket/editTbJobTicketGasAnalysis',
  tbJobTicketGasAnalysisDelete = '/TbJobTicket/tbJobTicket/deleteTbJobTicketGasAnalysis',
  tbJobTicketGasAnalysisDeleteBatch = '/TbJobTicket/tbJobTicket/deleteBatchTbJobTicketGasAnalysis',
  tbJobTicketMeasureRecordList = '/TbJobTicket/tbJobTicket/listTbJobTicketMeasureRecordByMainId',
  tbJobTicketMeasureRecordSave= '/TbJobTicket/tbJobTicket/addTbJobTicketMeasureRecord',
  tbJobTicketMeasureRecordEdit= '/TbJobTicket/tbJobTicket/editTbJobTicketMeasureRecord',
  tbJobTicketMeasureRecordDelete = '/TbJobTicket/tbJobTicket/deleteTbJobTicketMeasureRecord',
  tbJobTicketMeasureRecordDeleteBatch = '/TbJobTicket/tbJobTicket/deleteBatchTbJobTicketMeasureRecord',
  tbJobTicketExamineRecordList = '/TbJobTicket/tbJobTicket/listTbJobTicketExamineRecordByMainId',
  tbJobTicketExamineRecordSave= '/TbJobTicket/tbJobTicket/addTbJobTicketExamineRecord',
  tbJobTicketExamineRecordEdit= '/TbJobTicket/tbJobTicket/editTbJobTicketExamineRecord',
  tbJobTicketExamineRecordDelete = '/TbJobTicket/tbJobTicket/deleteTbJobTicketExamineRecord',
  tbJobTicketExamineRecordDeleteBatch = '/TbJobTicket/tbJobTicket/deleteBatchTbJobTicketExamineRecord',
  tbJobTicketSecurityDisclosureRecordList = '/TbJobTicket/tbJobTicket/listTbJobTicketSecurityDisclosureRecordByMainId',
  tbJobTicketSecurityDisclosureRecordSave= '/TbJobTicket/tbJobTicket/addTbJobTicketSecurityDisclosureRecord',
  tbJobTicketSecurityDisclosureRecordEdit= '/TbJobTicket/tbJobTicket/editTbJobTicketSecurityDisclosureRecord',
  tbJobTicketSecurityDisclosureRecordDelete = '/TbJobTicket/tbJobTicket/deleteTbJobTicketSecurityDisclosureRecord',
  tbJobTicketSecurityDisclosureRecordDeleteBatch = '/TbJobTicket/tbJobTicket/deleteBatchTbJobTicketSecurityDisclosureRecord',
  tbJobTicketCourseRecordList = '/TbJobTicket/tbJobTicket/listTbJobTicketCourseRecordByMainId',
  tbJobTicketCourseRecordSave= '/TbJobTicket/tbJobTicket/addTbJobTicketCourseRecord',
  tbJobTicketCourseRecordEdit= '/TbJobTicket/tbJobTicket/editTbJobTicketCourseRecord',
  tbJobTicketCourseRecordDelete = '/TbJobTicket/tbJobTicket/deleteTbJobTicketCourseRecord',
  tbJobTicketCourseRecordDeleteBatch = '/TbJobTicket/tbJobTicket/deleteBatchTbJobTicketCourseRecord',
  tbJobTicketAcceptanceCheckRecordList = '/TbJobTicket/tbJobTicket/listTbJobTicketAcceptanceCheckRecordByMainId',
  tbJobTicketAcceptanceCheckRecordSave= '/TbJobTicket/tbJobTicket/addTbJobTicketAcceptanceCheckRecord',
  tbJobTicketAcceptanceCheckRecordEdit= '/TbJobTicket/tbJobTicket/editTbJobTicketAcceptanceCheckRecord',
  tbJobTicketAcceptanceCheckRecordDelete = '/TbJobTicket/tbJobTicket/deleteTbJobTicketAcceptanceCheckRecord',
  tbJobTicketAcceptanceCheckRecordDeleteBatch = '/TbJobTicket/tbJobTicket/deleteBatchTbJobTicketAcceptanceCheckRecord',
  tbJobTicketProblemRecordList = '/TbJobTicket/tbJobTicket/listTbJobTicketProblemRecordByMainId',
  tbJobTicketProblemRecordSave= '/TbJobTicket/tbJobTicket/addTbJobTicketProblemRecord',
  tbJobTicketProblemRecordEdit= '/TbJobTicket/tbJobTicket/editTbJobTicketProblemRecord',
  tbJobTicketProblemRecordDelete = '/TbJobTicket/tbJobTicket/deleteTbJobTicketProblemRecord',
  tbJobTicketProblemRecordDeleteBatch = '/TbJobTicket/tbJobTicket/deleteBatchTbJobTicketProblemRecord',
  tbJobTicketViolationCaptureList = '/TbJobTicket/tbJobTicket/listTbJobTicketViolationCaptureByMainId',
  tbJobTicketViolationCaptureSave= '/TbJobTicket/tbJobTicket/addTbJobTicketViolationCapture',
  tbJobTicketViolationCaptureEdit= '/TbJobTicket/tbJobTicket/editTbJobTicketViolationCapture',
  tbJobTicketViolationCaptureDelete = '/TbJobTicket/tbJobTicket/deleteTbJobTicketViolationCapture',
  tbJobTicketViolationCaptureDeleteBatch = '/TbJobTicket/tbJobTicket/deleteBatchTbJobTicketViolationCapture',
  
  queryJobCode = '/TbJobTicket/tbJobTicket/queryJobCode',
  queryJobCountByEventIdAndJobType = '/TbJobTicket/tbJobTicket/queryJobCountByEventIdAndJobType',
  saveGenerateTickets = '/TbJobTicket/tbJobTicket/generateTickets',
  initiateApprovalById = '/TbJobTicket/tbJobTicket/initiateApprovalById',
  
  generateReportAndDownload = '/freemarker/generateReportAndDownload',
  generateReport = '/freemarker/generateReport',
  jeecgDemoHtml = '/test/jeecgDemo/html',
  generateExportAndDownload = '/TbJobTicket/tbJobTicket/generateExportAndDownload',
}
/**
 * 导出api
 * @param params
 */
export const getExportUrl = Api.exportXls;

/**
 * 导入api
 */
export const getImportUrl = Api.importExcel;

/**
 * 列表接口
 * @param params
 */
export const list = (params) =>
  defHttp.get({ url: Api.list, params });
  
/**
 * 关联列表列表接口
 * @param params
 */
export const listForRelevanceJobTicket = (params) =>
  defHttp.get({ url: Api.listForRelevanceJobTicket, params });

/**
 * 删除单个
 */
export const deleteOne = (params,handleSuccess) => {
  return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
}

/**
 * 批量删除
 * @param params
 */
export const batchDelete = (params, handleSuccess) => {
  createConfirm({
    iconType: 'warning',
    title: '确认删除',
    content: '是否删除选中数据',
    okText: '确认',
    cancelText: '取消',
    onOk: () => {
      return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
        handleSuccess();
      });
    }
  });
}

/**
 * 保存或者更新
 * @param params
 */
export const saveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.edit : Api.save;
  return defHttp.post({ url: url, params },{ isTransformResponse: false });
}

/**
 * 发起签批
 */
export const initiateApproval = (params,handleSuccess) => {
  return defHttp.get({ url: Api.initiateApprovalById, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
}

/**
 * 生成票据
 * @param params
 */
export const saveGenerateTickets = (params) => {
  return defHttp.post({ url: Api.saveGenerateTickets, params },{ isTransformResponse: false });
}
  
/**
 * 列表接口
 * @param params
 */
export const tbJobTicketAuditRecordList = (params) => {
  if(params['jobTicketId']){
    return defHttp.get({ url: Api.tbJobTicketAuditRecordList, params });
  }
  return Promise.resolve({});
}

/**
 * 删除单个
 */
export const tbJobTicketAuditRecordDelete = (params,handleSuccess) => {
  return defHttp.delete({ url: Api.tbJobTicketAuditRecordDelete, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
}

/**
 * 批量删除
 * @param params
 */
export const tbJobTicketAuditRecordDeleteBatch = (params, handleSuccess) => {
  createConfirm({
    iconType: 'warning',
    title: '确认删除',
    content: '是否删除选中数据',
    okText: '确认',
    cancelText: '取消',
    onOk: () => {
      return defHttp.delete({ url: Api.tbJobTicketAuditRecordDeleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
        handleSuccess();
      });
    }
  });
}

/**
 * 保存或者更新
 * @param params
 */
export const  tbJobTicketAuditRecordSaveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.tbJobTicketAuditRecordEdit : Api.tbJobTicketAuditRecordSave;
  return defHttp.post({ url: url, params },{ isTransformResponse: false });
}

/**
 * 导入
 */
export const tbJobTicketAuditRecordImportUrl = '/TbJobTicket/tbJobTicket/importTbJobTicketAuditRecord'

/**
 * 导出
 */
export const tbJobTicketAuditRecordExportXlsUrl = '/TbJobTicket/tbJobTicket/exportTbJobTicketAuditRecord'
  
/**
 * 列表接口
 * @param params
 */
export const tbJobTicketJsaAnalyzeList = (params) => {
  if(params['jobTicketId']){
    return defHttp.get({ url: Api.tbJobTicketJsaAnalyzeList, params });
  }
  return Promise.resolve({});
}

/**
 * 删除单个
 */
export const tbJobTicketJsaAnalyzeDelete = (params,handleSuccess) => {
  return defHttp.delete({ url: Api.tbJobTicketJsaAnalyzeDelete, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
}

/**
 * 批量删除
 * @param params
 */
export const tbJobTicketJsaAnalyzeDeleteBatch = (params, handleSuccess) => {
  createConfirm({
    iconType: 'warning',
    title: '确认删除',
    content: '是否删除选中数据',
    okText: '确认',
    cancelText: '取消',
    onOk: () => {
      return defHttp.delete({ url: Api.tbJobTicketJsaAnalyzeDeleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
        handleSuccess();
      });
    }
  });
}

/**
 * 保存或者更新
 * @param params
 */
export const  tbJobTicketJsaAnalyzeSaveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.tbJobTicketJsaAnalyzeEdit : Api.tbJobTicketJsaAnalyzeSave;
  return defHttp.post({ url: url, params },{ isTransformResponse: false });
}

/**
 * 导入
 */
export const tbJobTicketJsaAnalyzeImportUrl = '/TbJobTicket/tbJobTicket/importTbJobTicketJsaAnalyze'

/**
 * 导出
 */
export const tbJobTicketJsaAnalyzeExportXlsUrl = '/TbJobTicket/tbJobTicket/exportTbJobTicketJsaAnalyze'
  
/**
 * 列表接口
 * @param params
 */
export const tbJobTicketGasAnalysisList = (params) => {
  if(params['jobTicketId']){
    return defHttp.get({ url: Api.tbJobTicketGasAnalysisList, params });
  }
  return Promise.resolve({});
}

/**
 * 删除单个
 */
export const tbJobTicketGasAnalysisDelete = (params,handleSuccess) => {
  return defHttp.delete({ url: Api.tbJobTicketGasAnalysisDelete, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
}

/**
 * 批量删除
 * @param params
 */
export const tbJobTicketGasAnalysisDeleteBatch = (params, handleSuccess) => {
  createConfirm({
    iconType: 'warning',
    title: '确认删除',
    content: '是否删除选中数据',
    okText: '确认',
    cancelText: '取消',
    onOk: () => {
      return defHttp.delete({ url: Api.tbJobTicketGasAnalysisDeleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
        handleSuccess();
      });
    }
  });
}

/**
 * 保存或者更新
 * @param params
 */
export const  tbJobTicketGasAnalysisSaveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.tbJobTicketGasAnalysisEdit : Api.tbJobTicketGasAnalysisSave;
  return defHttp.post({ url: url, params },{ isTransformResponse: false });
}

/**
 * 导入
 */
export const tbJobTicketGasAnalysisImportUrl = '/TbJobTicket/tbJobTicket/importTbJobTicketGasAnalysis'

/**
 * 导出
 */
export const tbJobTicketGasAnalysisExportXlsUrl = '/TbJobTicket/tbJobTicket/exportTbJobTicketGasAnalysis'
  
/**
 * 列表接口
 * @param params
 */
export const tbJobTicketMeasureRecordList = (params) => {
  if(params['jobTicketId']){
    return defHttp.get({ url: Api.tbJobTicketMeasureRecordList, params });
  }
  return Promise.resolve({});
}

/**
 * 删除单个
 */
export const tbJobTicketMeasureRecordDelete = (params,handleSuccess) => {
  return defHttp.delete({ url: Api.tbJobTicketMeasureRecordDelete, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
}

/**
 * 批量删除
 * @param params
 */
export const tbJobTicketMeasureRecordDeleteBatch = (params, handleSuccess) => {
  createConfirm({
    iconType: 'warning',
    title: '确认删除',
    content: '是否删除选中数据',
    okText: '确认',
    cancelText: '取消',
    onOk: () => {
      return defHttp.delete({ url: Api.tbJobTicketMeasureRecordDeleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
        handleSuccess();
      });
    }
  });
}

/**
 * 保存或者更新
 * @param params
 */
export const  tbJobTicketMeasureRecordSaveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.tbJobTicketMeasureRecordEdit : Api.tbJobTicketMeasureRecordSave;
  return defHttp.post({ url: url, params },{ isTransformResponse: false });
}

/**
 * 导入
 */
export const tbJobTicketMeasureRecordImportUrl = '/TbJobTicket/tbJobTicket/importTbJobTicketMeasureRecord'

/**
 * 导出
 */
export const tbJobTicketMeasureRecordExportXlsUrl = '/TbJobTicket/tbJobTicket/exportTbJobTicketMeasureRecord'
  
/**
 * 列表接口
 * @param params
 */
export const tbJobTicketExamineRecordList = (params) => {
  if(params['jobTicketId']){
    return defHttp.get({ url: Api.tbJobTicketExamineRecordList, params });
  }
  return Promise.resolve({});
}

/**
 * 删除单个
 */
export const tbJobTicketExamineRecordDelete = (params,handleSuccess) => {
  return defHttp.delete({ url: Api.tbJobTicketExamineRecordDelete, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
}

/**
 * 批量删除
 * @param params
 */
export const tbJobTicketExamineRecordDeleteBatch = (params, handleSuccess) => {
  createConfirm({
    iconType: 'warning',
    title: '确认删除',
    content: '是否删除选中数据',
    okText: '确认',
    cancelText: '取消',
    onOk: () => {
      return defHttp.delete({ url: Api.tbJobTicketExamineRecordDeleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
        handleSuccess();
      });
    }
  });
}

/**
 * 保存或者更新
 * @param params
 */
export const  tbJobTicketExamineRecordSaveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.tbJobTicketExamineRecordEdit : Api.tbJobTicketExamineRecordSave;
  return defHttp.post({ url: url, params },{ isTransformResponse: false });
}

/**
 * 导入
 */
export const tbJobTicketExamineRecordImportUrl = '/TbJobTicket/tbJobTicket/importTbJobTicketExamineRecord'

/**
 * 导出
 */
export const tbJobTicketExamineRecordExportXlsUrl = '/TbJobTicket/tbJobTicket/exportTbJobTicketExamineRecord'
  
/**
 * 列表接口
 * @param params
 */
export const tbJobTicketSecurityDisclosureRecordList = (params) => {
  if(params['jobTicketId']){
    return defHttp.get({ url: Api.tbJobTicketSecurityDisclosureRecordList, params });
  }
  return Promise.resolve({});
}

/**
 * 删除单个
 */
export const tbJobTicketSecurityDisclosureRecordDelete = (params,handleSuccess) => {
  return defHttp.delete({ url: Api.tbJobTicketSecurityDisclosureRecordDelete, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
}

/**
 * 批量删除
 * @param params
 */
export const tbJobTicketSecurityDisclosureRecordDeleteBatch = (params, handleSuccess) => {
  createConfirm({
    iconType: 'warning',
    title: '确认删除',
    content: '是否删除选中数据',
    okText: '确认',
    cancelText: '取消',
    onOk: () => {
      return defHttp.delete({ url: Api.tbJobTicketSecurityDisclosureRecordDeleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
        handleSuccess();
      });
    }
  });
}

/**
 * 保存或者更新
 * @param params
 */
export const  tbJobTicketSecurityDisclosureRecordSaveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.tbJobTicketSecurityDisclosureRecordEdit : Api.tbJobTicketSecurityDisclosureRecordSave;
  return defHttp.post({ url: url, params },{ isTransformResponse: false });
}

/**
 * 导入
 */
export const tbJobTicketSecurityDisclosureRecordImportUrl = '/TbJobTicket/tbJobTicket/importTbJobTicketSecurityDisclosureRecord'

/**
 * 导出
 */
export const tbJobTicketSecurityDisclosureRecordExportXlsUrl = '/TbJobTicket/tbJobTicket/exportTbJobTicketSecurityDisclosureRecord'
  
/**
 * 列表接口
 * @param params
 */
export const tbJobTicketCourseRecordList = (params) => {
  if(params['jobTicketId']){
    return defHttp.get({ url: Api.tbJobTicketCourseRecordList, params });
  }
  return Promise.resolve({});
}

/**
 * 删除单个
 */
export const tbJobTicketCourseRecordDelete = (params,handleSuccess) => {
  return defHttp.delete({ url: Api.tbJobTicketCourseRecordDelete, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
}

/**
 * 批量删除
 * @param params
 */
export const tbJobTicketCourseRecordDeleteBatch = (params, handleSuccess) => {
  createConfirm({
    iconType: 'warning',
    title: '确认删除',
    content: '是否删除选中数据',
    okText: '确认',
    cancelText: '取消',
    onOk: () => {
      return defHttp.delete({ url: Api.tbJobTicketCourseRecordDeleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
        handleSuccess();
      });
    }
  });
}

/**
 * 保存或者更新
 * @param params
 */
export const  tbJobTicketCourseRecordSaveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.tbJobTicketCourseRecordEdit : Api.tbJobTicketCourseRecordSave;
  return defHttp.post({ url: url, params },{ isTransformResponse: false });
}

/**
 * 导入
 */
export const tbJobTicketCourseRecordImportUrl = '/TbJobTicket/tbJobTicket/importTbJobTicketCourseRecord'

/**
 * 导出
 */
export const tbJobTicketCourseRecordExportXlsUrl = '/TbJobTicket/tbJobTicket/exportTbJobTicketCourseRecord'

/**
 * 列表接口
 * @param params
 */
export const tbJobTicketAcceptanceCheckRecordList = (params) => {
  if(params['jobTicketId']){
    return defHttp.get({ url: Api.tbJobTicketAcceptanceCheckRecordList, params });
  }
  return Promise.resolve({});
}

/**
 * 删除单个
 */
export const tbJobTicketAcceptanceCheckRecordDelete = (params,handleSuccess) => {
  return defHttp.delete({ url: Api.tbJobTicketAcceptanceCheckRecordDelete, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
}

/**
 * 批量删除
 * @param params
 */
export const tbJobTicketAcceptanceCheckRecordDeleteBatch = (params, handleSuccess) => {
  createConfirm({
    iconType: 'warning',
    title: '确认删除',
    content: '是否删除选中数据',
    okText: '确认',
    cancelText: '取消',
    onOk: () => {
      return defHttp.delete({ url: Api.tbJobTicketAcceptanceCheckRecordDeleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
        handleSuccess();
      });
    }
  });
}

/**
 * 保存或者更新
 * @param params
 */
export const  tbJobTicketAcceptanceCheckRecordSaveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.tbJobTicketAcceptanceCheckRecordEdit : Api.tbJobTicketAcceptanceCheckRecordSave;
  return defHttp.post({ url: url, params },{ isTransformResponse: false });
}

/**
 * 导入
 */
export const tbJobTicketAcceptanceCheckRecordImportUrl = '/TbJobTicket/tbJobTicket/importTbJobTicketAcceptanceCheckRecord'

/**
 * 导出
 */
export const tbJobTicketAcceptanceCheckRecordExportXlsUrl = '/TbJobTicket/tbJobTicket/exportTbJobTicketAcceptanceCheckRecord'
  
/**
 * 列表接口
 * @param params
 */
export const tbJobTicketProblemRecordList = (params) => {
  if(params['jobTicketId']){
    return defHttp.get({ url: Api.tbJobTicketProblemRecordList, params });
  }
  return Promise.resolve({});
}

/**
 * 删除单个
 */
export const tbJobTicketProblemRecordDelete = (params,handleSuccess) => {
  return defHttp.delete({ url: Api.tbJobTicketProblemRecordDelete, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
}

/**
 * 批量删除
 * @param params
 */
export const tbJobTicketProblemRecordDeleteBatch = (params, handleSuccess) => {
  createConfirm({
    iconType: 'warning',
    title: '确认删除',
    content: '是否删除选中数据',
    okText: '确认',
    cancelText: '取消',
    onOk: () => {
      return defHttp.delete({ url: Api.tbJobTicketProblemRecordDeleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
        handleSuccess();
      });
    }
  });
}

/**
 * 保存或者更新
 * @param params
 */
export const  tbJobTicketProblemRecordSaveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.tbJobTicketProblemRecordEdit : Api.tbJobTicketProblemRecordSave;
  return defHttp.post({ url: url, params },{ isTransformResponse: false });
}

/**
 * 导入
 */
export const tbJobTicketProblemRecordImportUrl = '/TbJobTicket/tbJobTicket/importTbJobTicketProblemRecord'

/**
 * 导出
 */
export const tbJobTicketProblemRecordExportXlsUrl = '/TbJobTicket/tbJobTicket/exportTbJobTicketProblemRecord'
  
/**
 * 列表接口
 * @param params
 */
export const tbJobTicketViolationCaptureList = (params) => {
  if(params['jobTicketId']){
    return defHttp.get({ url: Api.tbJobTicketViolationCaptureList, params });
  }
  return Promise.resolve({});
}

/**
 * 删除单个
 */
export const tbJobTicketViolationCaptureDelete = (params,handleSuccess) => {
  return defHttp.delete({ url: Api.tbJobTicketViolationCaptureDelete, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
}

/**
 * 批量删除
 * @param params
 */
export const tbJobTicketViolationCaptureDeleteBatch = (params, handleSuccess) => {
  createConfirm({
    iconType: 'warning',
    title: '确认删除',
    content: '是否删除选中数据',
    okText: '确认',
    cancelText: '取消',
    onOk: () => {
      return defHttp.delete({ url: Api.tbJobTicketViolationCaptureDeleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
        handleSuccess();
      });
    }
  });
}

/**
 * 保存或者更新
 * @param params
 */
export const  tbJobTicketViolationCaptureSaveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.tbJobTicketViolationCaptureEdit : Api.tbJobTicketViolationCaptureSave;
  return defHttp.post({ url: url, params },{ isTransformResponse: false });
}

/**
 * 导入
 */
export const tbJobTicketViolationCaptureImportUrl = '/TbJobTicket/tbJobTicket/importTbJobTicketViolationCapture'

/**
 * 导出
 */
export const tbJobTicketViolationCaptureExportXlsUrl = '/TbJobTicket/tbJobTicket/exportTbJobTicketViolationCapture'

/**
 * 列表接口
 * @param params
 */
export const queryJobCode = (params) => {
  return defHttp.get({ url: Api.queryJobCode, params });
}

/**
 * 列表接口
 * @param params
 */
export const queryJobCountByEventIdAndJobType = (params) => {
  return defHttp.get({ url: Api.queryJobCountByEventIdAndJobType, params });
}
//------------------------------------------------//
/**
 * 导出api
 * @param params
 */
export const generateReportAndDownload = Api.exportXls;

/**
 * 电子作业票模版接口
 * @param params
 */
// export const generateReportAndDownload = (params) => {
//   return defHttp.get({ url: Api.generateReportAndDownload, params });
// }

/**
 * 电子作业票模版接口
 * @param params
 */
export const generateReport = (params) => {
  return defHttp.get({ url: Api.generateReport, params });
}

/**
 * 电子作业票模版接口
 * @param params
 */
export const jeecgDemoHtml = (params) => {
  return defHttp.get({ url: Api.jeecgDemoHtml, params });
}

/**
 * 电子作业票模版接口
 * @param params
 */
export const generateExportAndDownload = (params) => {
  return defHttp.get({ url: Api.generateExportAndDownload, params });
}
